package shipping.api;

import member.model.shop.MemberInVoice;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import shipping.api.vo.ShippingInfoIdShippingNoVo;
import shipping.api.vo.ShippingInfoVo;
import shipping.api.vo.ShippingSenderVo;
//import shipping.api.vo.ShippingTraceInfoVo;
import shipping.model.ShippingInfo;
import utils.web.ResponseMapUtils;

import java.util.List;
import java.util.Map;

/**
 * 第三方物流相关接口
 * Created by Liang Wenxu on 2017-03-09.
 */
public interface ShippingInfoApi {
    public ShippingInfo findById(String id);

    public List<ShippingInfo> findByIds(List<String> ids);

    public List<ShippingInfoVo> findVoByIds(List<String> ids);

    /**
     * 条件查询（带分页）
     * @param example 查询对象，不需要的条件对应变量为null，其中
     * @param pageable
     * @return
     */
    public Page<ShippingInfo> findByExamplePaged(ShippingInfo example, Pageable pageable);

    /**
     * 新增ShippingInfo
     * @param shippingInfoVo
     * @return
     *  @see ResponseMapUtils
     */
    public Map createShippingInfo(ShippingInfoVo shippingInfoVo);

    /**
     * 批量新增ShippingInfo
     * @param shippingInfoVo
     * @return
     *  @see ResponseMapUtils
     */
    public Map createShippingInfo(List<ShippingInfoVo> shippingInfoVo);

    /**
     * 直接从发票信息生成配送信息
     * @param memberInVoiceId memberInVoice表id（需已打印）
     * @param orgId 机构ID
     * @param sender ShippingSenderVo 如传null，则使用当前Service默认配置
     * @return
     * @see ResponseMapUtils
     */
    public Map createShippingInfoByInvoice(MemberInVoice memberInVoice, String orgId, ShippingSenderVo sender);

    /**
     * 更新物流信息表的第三方物流单号
     * @param shippingInfoIdShippingNoVoList
     * @return
     */
    public int updateShippingNo(List<ShippingInfoIdShippingNoVo> shippingInfoIdShippingNoVoList);

    /**
     * 物流信息跟踪
     * @param shippingNo
     * @return
     */
//    public ShippingTraceInfoVo traceShipping(String shippingNo);
}
